Skip to content

Conversation

kroecks
Copy link

@kroecks kroecks commented Oct 5, 2025

Didn't mean to create; sorry. Was attempting to push into my own fork.

This change represents a lump of the changes necessary to use Addressables in for scene management with netcode.

Essentially, you just need a single bootstrap scene in the build list.

Every other scene should have its Addressables id be its scene name.

Then, when you go to load a scene, it will resolve the entity in the addressables system with that id. This will begin downloading the scene, if it does not already have it, and then load it.

As this is all handled with async handles, it's a fairly simply replacement if you make a class to hold on to the SceneInstance reference and such.

ShadauxCat and others added 30 commits March 27, 2024 19:19
…etworkTransform and support for throttling functionality in NetworkVariables (Unity-Technologies#2820)
…ologies#2861)

* update

adding the develop-2.0.0 branch to triggers and conventional pr.

* Revert "update"

This reverts commit 77aa22e.

* update

adding develop-2.0.0 to conventional PR

* update

adding to auto update

* Update autoupdate.yaml
…is enabled (Unity-Technologies#2845)

* fix

Edge case fix for half float precision not getting the proper initial base offset.

* update

adding change log entry

* update

adding PR number

* test

updating some of the tests to reduce the verbosity of the debug output.
…s#2871)

* Fix physics2d not working without physics

* update

updating changelog

---------

Co-authored-by: Depri0n <[email protected]>
Co-authored-by: Deprion <[email protected]>
…s#2872)

* Do not require component Animator on NetworkAnimator.

* update

Adding changelog entry.

---------

Co-authored-by: jeffgamedev <[email protected]>
Co-authored-by: Jeff Brooks <[email protected]>
…e and NetworkObjectReference (Unity-Technologies#2874)

* initial commit

* update

adding changelog entry

* update and style

Fixing some style issues along with property type issues.

* test

Adding some generalized testing to validate both NetworkBehaviourReference and NetworkObjectReference can be created using a null and serialized when null.

* update

Updating the changed description.

---------

Co-authored-by: Simone Guggiari <[email protected]>
* Update API docs for MaxPayloadSize

* Update to API remark following review
* Adding missing words for OnDestroy API doc

* Reference pointing to what?

* Improving remarks for OnServerStopped and OnClientStopped

* Updates to summary from review

* Formatting
* chore: tag change log (Unity-Technologies#2866)

* chore: merge develop into 1.9.0 release (Unity-Technologies#2873)

* test

Increasing timeout for 2 URPC tests that commonly timeout.

* style

adding comments

* update-temp

Running tests on only 2022.3

* style and test

Adjusting URPC tests.
Fixing naming convention violation.

* test

increase number of bytes to adjust under CorruptBytes pass.

* style

missing white space

* Revert "update-temp"

This reverts commit 0958d04.

* chore: bumping to v1.9.1 initial package release version (Unity-Technologies#2887)

* chore

bump initial package version.

* update

bumping version in changelog

* style

adding white space

* Update CHANGELOG.md

Removing this as it was not accurate.
* update

adding pre and post spawn methods.
clearing the m_ChildNetworkBehaviours on Awake.

* update

adding change log entries

* update

Needed to add a NetworkManager ref into the pre spawn method.
Needed to account for locally spawning.

* test

Adding test that validates the pre spawn and post spawn methods are invoked and that order of operations for OnNetworkSpawn invocation is not an issue with OnNetworkPostSpawn invocation.

* style

updating comments

* style

updating comments a bit more

* test

Migrating OnDynamicNetworkPreAndPostSpawn into its own class to avoid interfering with the generic tests.

* style

removing property no longer used and remove LF/CR

* update and test

Added NetworkBehaviour.OnNetworkSessionSynchronized and NetworkBehaviour.OnInSceneObjectsSpawned methods.

Added test to validate the above methods.

Added assets for the test to validate the above methods.
…10] (Unity-Technologies#2916)

* fix

This resolves the issue with Rigidbody2d not changing the body type based on changes to authority while also assuring the initial body type for Rigidbody2d is kinematic until spawned.

* test

Realized we needed an overhaul with our rigid body tests so I did a bit of refactoring.
Deleted the remaining of the completely commented out rigid body tests that are now being covered in the NetworkRigidbodyTests.
…n parented under gameobject [MTT-8402] (Unity-Technologies#2895)

* fix

Fixing issue where parenting synchronization on the authority side was not properly handling the scenario where a NetworkObject is parented under a GameObject (with or without auto object parent sync enabled).

* fix

Fixing issue where parenting synchronization on the non-authority side was not properly handling the scenario where a NetworkObject is parented under a GameObject (with or without auto object parent sync enabled).

* update

migrate when to apply in local space above the parenting check.

* test

Adding an integration test to validate an in-scene placed NetworkObject's initial synchronization when parented under a GameObject. This also test both scenarios where the in-scene placed NetworkObject does and does not have a NetworkTransform.

* style

Removing unused namespace

* update

Updating change log entry
…hnologies#2921)

* Fixed crash and added test for a message still existing in the message queue on shutdown.

* Fixing format errors.

---------

Co-authored-by: Noel Stephens <[email protected]>
* fix

This fixes an issue with using unreliable state updates, half-floats, and NetworkDeltaPosition.

* test

Adding test to validate the fix for using half float precision with unreliable deltas.
…nect (Unity-Technologies#2923)

* fix

Fixes an issue where in-scene placed NetworkObjects could be destroyed if a connection failed.

* test

Adding test to validate fix
…e [MTTB-135] (Unity-Technologies#2941)

* fix

This resolves the issue with the client count not being correct on the host or server side when a client disconnects itself from a session.

This also resolves the issue with the host trying to send itself a message that it has connected when first starting up.

Fixing issue with NetworkSceneManager finishing synchronization prior to the server connection timing out.

* test

Adding validation for the connected clients count on the server side when the client-side disconnects.
…-Technologies#2953)

* fix: Added support for byte on NetworkVariable through codegen

the codegen wasn't picking byte  - it's because a variable of a type other than NetworkVariable<byte> (such as NetworkVariable<FixedString32Bytes>) is serializing a byte value as part of its delta serialization. Delta serialization was added in NGO 1.9, which is why it doesn't happen in previous versions. This code assumes the existence of a byte serializer, but if the user doesn't have a NetworkVariable<byte> in their code, the byte serializer won't be initialized by the codegen pass.
credits: Kitty Drapper

* fix: Converted serialization operation to their appropriate Safe counterparts

Fixed safety issue that would trigger exception on runtime

* fix

Using WriteByteSafe as opposed to WriteValueSafe.

* update

adding changelog entry

---------

Co-authored-by: NoelStephensUnity <[email protected]>
…ining scenes not used [back port] (Unity-Technologies#2977)

* fix

remove the scene from the scenesLoaded dictionary when there are remaining scenes to be unloaded.

* test

back ported test updates

* update

Adding change log entry
…ease Builds (Unity-Technologies#2980)

* fix

Adding UNITY_MP_TOOLS_NET_STATS_MONITOR_ENABLED_IN_RELEASE to all of the various dependencies required to enable RNSM tracking of RPC messages.

* update

adding change log entry
…es#2987)

* yupdate

Updating version of package and changelog version

* updating changelog

---------

Co-authored-by: NoelStephensUnity <[email protected]>
* yupdate

Updating version of package and changelog version

* fix

removing the [GenerateSerializationForType(typeof(byte))] attributes.

* fix

fixing the issue of a missing byte serializer for fixedstrings.

* style

removing whitespace

* Update CHANGELOG.md
…-Technologies#2999)

* fix

This fixes the issue where a trigger that transitions to a state with a trigger that transitions back to the original state could cause NetworkAnimator to generate a false layer to layer state transition which would not only generate an additional message after the original trigger message, but would cause the non-authority instances to log a warning message.

* test - manual

This includes additional assets needed to test this fix manually as well as some of the assets included will be used in an integration test.

* test

Adding test for the dual trigger scenario.

* style

Adding additional comments about the update.
…ologies#3005)

* fix

Fixing some of the collections issues.
Adding a unified permissions error.
Replacing throw exceptions with logging errors and returning.

* tesat

adjustments for replacing throw exception and added internal unified permissions write error.

* fix

Adjustments made due to other issues with direct assignment.

* fix

back port typo.

* style

removing using directive.

* fix

Mark that we have a previous value for disposing when destroyed.

* fix

This fixes an issue with duplicating nested lists, hashsets, and dictionaries.

* test

This is the first set of tests for Lists, including nested, that test using base types and INetworkSerializable.
Still have HashSet and Dictionary to cover.

* test

Added Dictionary and HashSet to the tests.

* style

Removing whitespaces

* update

adding changelog entries

* update

Adding missed change log entries.
…logies#3011)

* adding null checks when accessing NetworkBehaviour

* updating PR number in changelog
…es#3024)

* updating changelog and package.json

* adding unreleased section to changelog
mbaker3 and others added 24 commits October 17, 2024 10:29
…ity-Technologies#3102)

NetworkPrefabProcessor now marks the default NetworkPrefabsList ScriptableObject asset as dirty if there are new imports OR deletions.

Unity is now aware of the changes and is able to write them to disk.
updating package
updating changelog
moving minimum editor back down to 6000.0
Fixing the changelog version goof of mine.
Making the license copyright just a year and not year range.
removing whitespace from copyright notice.
adding dash to changelog header
Removing whitespaces for PVP-124-2 issues.
missed one whitespace...
…ty-Technologies#3176)

* fix: clamp spawntimeout to recommended range (Unity-Technologies#3174)

* update

Clamping spawntimeout

* update

improving parenting failed message when either the child or parent NetworkObject is not spawnd.

* update

Update the local SceneEventData.SceneEventType on the authority side for SceneLoadComplete.

* style

removing whitespaces

* feat: Add a SessionOwner ObjectStatus and allow InScenePlaced network objects to be distributed (Unity-Technologies#3175)

* Initial pass on SessionOwner ownership flag

* feat: Add SessionOwner OwnershipStatus flag

* update

removing additional session owner accessor.

* Add OwnershipPermissions tests

* fix client connect

* Revert "fix client connect"

This reverts commit 3c3b354.

* update

object distribution for in-scene placed NetworkObjects needs to use the InScenePlacedSourceGlobalObjectIdHash when building an object distribution list.

* Add changelog

* Remove unnecessary change

* Remove Settings.json

* Reword CHANGELOG

* fix

DAHost should not distribute session owner permission NetworkObjects.
When client is promoted to session owner, for now newly promoted client takes ownership of NetworkObjects that have the SessionOwner permission set.
Only prevent non-session owners from taking ownership of a NetworkObject with the SessionOwner permission set.

* test fix

Avoid the RemoveOwnership client-server only method.

* style

Visual studio code cleanup likes to sort by alpha... fixing for our standards.

* update

Adding check for session owner trying to change ownership to a non-session owner client.

* test

Adding an additional validation that a non-session owner cannot change ownership and that a session owner cannot change ownership to a non-session owner when the NetworkObject in question has the SessionOwner permissions set.

---------

Co-authored-by: NoelStephensUnity <[email protected]>

---------

Co-authored-by: Emma <[email protected]>
NetworkAnimator started throwing this exception:
"Objects are trying to be loaded during a domain backup. This is not allowed as it will lead to undefined behaviour!"
When MPPM was being used. This has to do with the OnBeforeSerialize method and potentially an order of operations issue.
We can accomplish the same serialization within OnValidate, but went ahead and made it virtual in order to provide users with the ability to override and handle their own validation.
…ject table when started (Unity-Technologies#3177)

* fix

This fixes the issue with the server, host, or session owner not adding in-scene placed NetworkObjects to its internal table if the scene was loaded prior to starting the NetworkManager.

* update

Adding change log entry

* update

Adding PR# to this entry.

* style

remove whitespace
Setting the v2.3.1 change log
Setting the package version
# Conflicts:
#	.yamato/code-coverage.yml
#	.yamato/mobile-build-and-test.yml
#	.yamato/multiprocess-project-tests.yml
#	.yamato/project-pack.yml
#	.yamato/project-standards.yml
#	.yamato/project-tests.yml
#	.yamato/standalone-project-tests.yml
#	.yamato/webgl-build.yml
#	com.unity.netcode.gameobjects/CHANGELOG.md
#	com.unity.netcode.gameobjects/Editor/NetworkObjectEditor.cs
#	com.unity.netcode.gameobjects/Runtime/Components/NetworkTransform.cs
#	com.unity.netcode.gameobjects/Runtime/Connection/NetworkConnectionManager.cs
#	com.unity.netcode.gameobjects/Runtime/Core/NetworkManager.cs
#	com.unity.netcode.gameobjects/Runtime/Core/NetworkObject.cs
#	com.unity.netcode.gameobjects/Runtime/SceneManagement/NetworkSceneManager.cs
#	com.unity.netcode.gameobjects/Runtime/Spawning/NetworkSpawnManager.cs
#	com.unity.netcode.gameobjects/Runtime/Transports/UTP/UnityTransport.cs
#	com.unity.netcode.gameobjects/Tests/Runtime/DistributedAuthority/OwnershipPermissionsTests.cs
#	com.unity.netcode.gameobjects/package.json
#	minimalproject/Packages/packages-lock.json
#	minimalproject/ProjectSettings/ProjectVersion.txt
#	testproject/Assets/Tests/Runtime/testproject.runtimetests.asmdef
@kroecks kroecks requested review from NoelStephensUnity, EmandM and a team as code owners October 5, 2025 17:13
@kroecks kroecks changed the title Addressable Addressable scene loader Oct 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.